package com.tangyuan.user.controller;

import com.tangyuan.common.result.Result;
import com.tangyuan.dto.UserReportDto;
import com.tangyuan.user.service.UserReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserReportController {

    @Autowired
    UserReportService userReportService;

   @PostMapping("/report")
    public Result userReport(@RequestHeader(name = "userId",required = false) Long userId, @RequestBody @Validated UserReportDto userReportDto){
       return userReportService.userReport(userId,userReportDto);
   }


   // 进入软件 被举报提醒
   @GetMapping("/getReport")
   public Result getReport(@RequestHeader(name = "userId",required = false) Long userId){
       return userReportService.getReport(userId);
   }




}
